<?php 
header("Pragma: public");
header("Expires: 0");
header("Accept-Ranges: bytes");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-Type: application/vnd.ms-excel");
header('Content-Disposition: attachment; filename=abiturientsfct.xls');
header("Content-Transfer-Encoding: binary");
?>
<h4>Список абитуриентов сдающих ФЦТ с указанием предметов</h4>
<table border=1>
<tr>
	<th>№п/п</th>
	<th>ID</th>
	<th>ФИО</th>
	<th>Предметы</th>
</tr>
<?php 
	$i = 0;
	foreach ($abiturients as $key => $value):
	echo '<tr>';
		echo '<td>';
		$i++;
		echo $i;
		echo '</td>';	
		echo '<td>';
		echo $key;
		echo '</td>';
		echo '<td>';
		echo $value['fio'];
		echo '</td>';
		echo '<td>';
		sort($value['subjects']);
		foreach ($value['subjects'] as $subject):
		echo $subject.'<br>';
		endforeach;
		echo '</td>';				
	echo '</tr>';
	endforeach;
?>
</table>
